#ifndef __THREAD_H__
#define __THREAD_H__

#include<pthread.h>
#include"reactor.h"
#include"logger.h"
class Reactor;
class Thread
{
private:
    pthread_t m_tid;
    int m_channle[2];//管道
    Reactor* m_reactor;
public:
    static void SocketPairEventCallBack(int fd,short events,void*arg);
    static void ClientIOEventCallBack(int fd,short events,void*arg);
    static void* taskFunc(void*arg);
    /*
    {
        Thread *thread=static_cast<Thread*>(arg);
        LOG_INFO<<thread->m_tid;
    }
    */
    Thread();
    ~Thread();
    int GetSocketPairFirst()const;
    int GetSocketPairSecond()const;
    pthread_t GetTid()const;
};

#endif